package com.javandad.app.shared.entity;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "false")
public class Message implements java.io.Serializable, Mailable {
	
	private static final long serialVersionUID = -1434432970005784819L;
	@SuppressWarnings("unused")
	private Message(){
	}
	
	public Message(String sender, String receiver, String content,
			String title, Date dateOfDelivery) {
		super();
		this.sender = sender;
		this.receiver = receiver;
		this.content = content;
		this.title = title;
		this.dateOfDelivery = dateOfDelivery;
	}
	
	public String getSender() {
		return sender;
	}
	public String getReceiver() {
		return receiver;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	public Date getDateOfDelivery() {
		return dateOfDelivery;
	}
	public void setDateOfDelivery(Date dateOfDelivery) {
		this.dateOfDelivery = dateOfDelivery;
	}
	
	public long getId() {
		return id;
	}
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private String sender;
	@Persistent
	private String receiver;
	@Persistent
	private Date dateOfDelivery;
	@Persistent
	private String content;
	@Persistent
	private String title;
}
